﻿
namespace bookMaster.AssetSystem.Windows.Forms
{
	/// <summary>
	/// This is the abstract edit form for the <see cref="Entities.UsuariosRecursos"/> entity.
	/// </summary>
	/// <remarks>This class is overwritten by .netTiers at each generation.</remarks>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class UsuariosRecursosEditControlBase : System.Windows.Forms.UserControl
	{
		#region Fields
		
		//private System.Windows.Forms.TableLayoutPanel uxTableLayoutPanel;
		/// <summary>
		/// The ErrorProvider for the Entity;
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxErrorProvider;
		
		/// <summary>
		/// The BindingSource for the entity.
		///</summary>
		protected System.Windows.Forms.BindingSource uxBindingSource;
						
		
		/// <summary>
		/// ComboBox for the IdUsuario property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIdUsuario;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IdUsuario property.
		/// </summary>
		protected System.Windows.Forms.Label uxIdUsuarioLabel;
		
		/// <summary>
		/// ComboBox for the IdRecurso property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIdRecurso;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IdRecurso property.
		/// </summary>
		protected System.Windows.Forms.Label uxIdRecursoLabel;
		
		/// <summary>
		/// TextBox for the PermiteAcceso property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxPermiteAcceso;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the PermiteAcceso property.
		/// </summary>
		protected System.Windows.Forms.Label uxPermiteAccesoLabel;
		
		/// <summary>
		/// TextBox for the PermiteEscritura property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxPermiteEscritura;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the PermiteEscritura property.
		/// </summary>
		protected System.Windows.Forms.Label uxPermiteEscrituraLabel;
		
		/// <summary>
		/// TextBox for the PermisosEspeciales property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxPermisosEspeciales;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the PermisosEspeciales property.
		/// </summary>
		protected System.Windows.Forms.Label uxPermisosEspecialesLabel;
		#endregion
		
		#region Main entity
		private Entities.UsuariosRecursos _UsuariosRecursos;
		/// <summary>
		/// Gets or sets the <see cref="Entities.UsuariosRecursos"/> entity to edit with this form.
		/// </summary>
		/// <value>The <see cref="Entities.UsuariosRecursos"/> instance.</value>
		public Entities.UsuariosRecursos UsuariosRecursos
		{
			get {return this._UsuariosRecursos;}
			set
			{
				this._UsuariosRecursos = value;
				if (value != null) 
				{
					this.uxBindingSource.DataSource = value;
					BindControls();
				}			
				
			}
		}
		#endregion
		
		/// <summary>
		/// Binds the controls.
		/// </summary>
		private void BindControls()
		{
			this.uxIdUsuario.DataBindings.Clear();
			this.uxIdUsuario.DataBindings.Add("SelectedValue", this.uxBindingSource, "IdUsuario", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIdRecurso.DataBindings.Clear();
			this.uxIdRecurso.DataBindings.Add("SelectedValue", this.uxBindingSource, "IdRecurso", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxPermiteAcceso.DataBindings.Clear();
			this.uxPermiteAcceso.DataBindings.Add("Text", this.uxBindingSource, "PermiteAcceso", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxPermiteEscritura.DataBindings.Clear();
			this.uxPermiteEscritura.DataBindings.Add("Text", this.uxBindingSource, "PermiteEscritura", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxPermisosEspeciales.DataBindings.Clear();
			this.uxPermisosEspeciales.DataBindings.Add("Text", this.uxBindingSource, "PermisosEspeciales", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
		}					
		
		#region Constructor
		
		/// <summary>
		/// Initializes a new instance of the <see cref="UsuariosRecursosEditControlBase"/> class.
		/// </summary>
		public UsuariosRecursosEditControlBase()
		{
			InitializeComponent();			
			
			this.uxBindingSource.CurrentItemChanged += new System.EventHandler(uxBindingSource_currentItemChanged);
		}		
		
		/// <summary>
		/// 
		/// </summary>
		private void uxBindingSource_currentItemChanged(object sender, System.EventArgs e)
		{
			if (_UsuariosRecursos != null) _UsuariosRecursos.Validate();
		}	
				
		/// <summary>
		/// Initializes the component.
		/// </summary>
		public void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.uxErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxBindingSource = new System.Windows.Forms.BindingSource(this.components);
			
			//this.uxTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
			this.uxIdUsuario = new System.Windows.Forms.ComboBox();
			uxIdUsuarioLabel = new System.Windows.Forms.Label();
			this.uxIdRecurso = new System.Windows.Forms.ComboBox();
			uxIdRecursoLabel = new System.Windows.Forms.Label();
			this.uxPermiteAcceso = new System.Windows.Forms.TextBox();
			uxPermiteAccesoLabel = new System.Windows.Forms.Label();
			this.uxPermiteEscritura = new System.Windows.Forms.TextBox();
			uxPermiteEscrituraLabel = new System.Windows.Forms.Label();
			this.uxPermisosEspeciales = new System.Windows.Forms.TextBox();
			uxPermisosEspecialesLabel = new System.Windows.Forms.Label();
			
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).BeginInit();
			this.SuspendLayout();
			
			// 
			// uxTableLayoutPanel
			// 
			//this.uxTableLayoutPanel.AutoSize = true;
			//this.uxTableLayoutPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
			//this.uxTableLayoutPanel.ColumnCount = 2;
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F));
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 250F));
			//this.uxTableLayoutPanel.Location = new System.Drawing.System.Drawing.Point(3, 3);
			//this.uxTableLayoutPanel.Name = "uxTableLayoutPanel";
			//this.uxTableLayoutPanel.RowCount = 2;
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.Size = new System.Drawing.Size(450, 50);
			//this.uxTableLayoutPanel.TabIndex = 0;
			
			//
			// uxErrorProvider
			//
			this.uxErrorProvider.ContainerControl = this;
			this.uxErrorProvider.DataSource = this.uxBindingSource;
			
			//
			// uxIdUsuarioLabel
			//
			this.uxIdUsuarioLabel.Name = "uxIdUsuarioLabel";
			this.uxIdUsuarioLabel.Text = "Id Usuario:";
			this.uxIdUsuarioLabel.Location = new System.Drawing.Point(3, 0);
			this.Controls.Add(this.uxIdUsuarioLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIdUsuarioLabel);			
			//
			// uxIdUsuario
			//
			this.uxIdUsuario.Name = "uxIdUsuario";
			//this.uxTableLayoutPanel.Controls.Add(this.uxIdUsuario);
			this.uxIdUsuario.Location = new System.Drawing.Point(160, 0);
			this.Controls.Add(this.uxIdUsuario);
			//
			// uxIdRecursoLabel
			//
			this.uxIdRecursoLabel.Name = "uxIdRecursoLabel";
			this.uxIdRecursoLabel.Text = "Id Recurso:";
			this.uxIdRecursoLabel.Location = new System.Drawing.Point(3, 26);
			this.Controls.Add(this.uxIdRecursoLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIdRecursoLabel);			
			//
			// uxIdRecurso
			//
			this.uxIdRecurso.Name = "uxIdRecurso";
			//this.uxTableLayoutPanel.Controls.Add(this.uxIdRecurso);
			this.uxIdRecurso.Location = new System.Drawing.Point(160, 26);
			this.Controls.Add(this.uxIdRecurso);
			//
			// uxPermiteAccesoLabel
			//
			this.uxPermiteAccesoLabel.Name = "uxPermiteAccesoLabel";
			this.uxPermiteAccesoLabel.Text = "Permite Acceso:";
			this.uxPermiteAccesoLabel.Location = new System.Drawing.Point(3, 52);
			this.Controls.Add(this.uxPermiteAccesoLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxPermiteAccesoLabel);			
			//
			// uxPermiteAcceso
			//
			this.uxPermiteAcceso.Name = "uxPermiteAcceso";
			//this.uxTableLayoutPanel.Controls.Add(this.uxPermiteAcceso);
			this.uxPermiteAcceso.Location = new System.Drawing.Point(160, 52);
			this.Controls.Add(this.uxPermiteAcceso);
			//
			// uxPermiteEscrituraLabel
			//
			this.uxPermiteEscrituraLabel.Name = "uxPermiteEscrituraLabel";
			this.uxPermiteEscrituraLabel.Text = "Permite Escritura:";
			this.uxPermiteEscrituraLabel.Location = new System.Drawing.Point(3, 78);
			this.Controls.Add(this.uxPermiteEscrituraLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxPermiteEscrituraLabel);			
			//
			// uxPermiteEscritura
			//
			this.uxPermiteEscritura.Name = "uxPermiteEscritura";
			//this.uxTableLayoutPanel.Controls.Add(this.uxPermiteEscritura);
			this.uxPermiteEscritura.Location = new System.Drawing.Point(160, 78);
			this.Controls.Add(this.uxPermiteEscritura);
			//
			// uxPermisosEspecialesLabel
			//
			this.uxPermisosEspecialesLabel.Name = "uxPermisosEspecialesLabel";
			this.uxPermisosEspecialesLabel.Text = "Permisos Especiales:";
			this.uxPermisosEspecialesLabel.Location = new System.Drawing.Point(3, 104);
			this.Controls.Add(this.uxPermisosEspecialesLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxPermisosEspecialesLabel);			
			//
			// uxPermisosEspeciales
			//
			this.uxPermisosEspeciales.Name = "uxPermisosEspeciales";
			//this.uxTableLayoutPanel.Controls.Add(this.uxPermisosEspeciales);
			this.uxPermisosEspeciales.Location = new System.Drawing.Point(160, 104);
			this.Controls.Add(this.uxPermisosEspeciales);
			//
			// uxIdRecurso
			//				
			this.uxIdRecurso.DisplayMember = "LlaveRecurso";	
			this.uxIdRecurso.ValueMember = "IdRecurso";	
			//
			// uxIdUsuario
			//				
			this.uxIdUsuario.DisplayMember = "NombreUsuario";	
			this.uxIdUsuario.ValueMember = "IdUsuario";	
			// 
			// UsuariosRecursosEditControlBase
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			//this.Controls.Add(this.uxTableLayoutPanel);
			this.AutoScroll = true;
			this.Name = "UsuariosRecursosEditControlBase";
			this.Size = new System.Drawing.Size(478, 311);
			//this.Localizable = true;
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).EndInit();			
			this.ResumeLayout(false);
			this.PerformLayout();
		}
		#endregion
				
		#region ComboBox List
		
				
		private Entities.TList<Entities.Recursos> _IdRecursoList;
		
		/// <summary>
		/// The ComboBox associated with the IdRecurso property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.Recursos> IdRecursoList
		{
			get {return _IdRecursoList;}
			set 
			{
				this._IdRecursoList = value;
				this.uxIdRecurso.DataSource = null;
				this.uxIdRecurso.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIdRecursoList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IdRecurso property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIdRecursoList
		{
			get { return _allowNewItemInIdRecursoList;}
			set
			{
				this._allowNewItemInIdRecursoList = value;
				this.uxIdRecurso.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
				
		private Entities.TList<Entities.Usuarios> _IdUsuarioList;
		
		/// <summary>
		/// The ComboBox associated with the IdUsuario property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.Usuarios> IdUsuarioList
		{
			get {return _IdUsuarioList;}
			set 
			{
				this._IdUsuarioList = value;
				this.uxIdUsuario.DataSource = null;
				this.uxIdUsuario.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIdUsuarioList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IdUsuario property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIdUsuarioList
		{
			get { return _allowNewItemInIdUsuarioList;}
			set
			{
				this._allowNewItemInIdUsuarioList = value;
				this.uxIdUsuario.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
		
		#endregion
		
        #region Field visibility

        /// <summary>
        /// Indicates if the controls associated with the uxIdUsuario property should be visible.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Visible property for related controls.")]
        public bool uxIdUsuarioVisible
        {
            get { return this.uxIdUsuario.Visible; }
            set
            {
                this.uxIdUsuarioLabel.Visible = value;
                this.uxIdUsuario.Visible = value;
            }
        }

        /// <summary>
        /// Indicates if the controls associated with the uxIdUsuario property should be enabled.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Enabled property for related controls.")]
        public bool uxIdUsuarioEnabled
        {
            get { return this.uxIdUsuario.Enabled; }
            set
            {
                this.uxIdUsuario.Enabled = value;
            }
        }
        /// <summary>
        /// Indicates if the controls associated with the uxIdRecurso property should be visible.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Visible property for related controls.")]
        public bool uxIdRecursoVisible
        {
            get { return this.uxIdRecurso.Visible; }
            set
            {
                this.uxIdRecursoLabel.Visible = value;
                this.uxIdRecurso.Visible = value;
            }
        }

        /// <summary>
        /// Indicates if the controls associated with the uxIdRecurso property should be enabled.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Enabled property for related controls.")]
        public bool uxIdRecursoEnabled
        {
            get { return this.uxIdRecurso.Enabled; }
            set
            {
                this.uxIdRecurso.Enabled = value;
            }
        }
        /// <summary>
        /// Indicates if the controls associated with the uxPermiteAcceso property should be visible.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Visible property for related controls.")]
        public bool uxPermiteAccesoVisible
        {
            get { return this.uxPermiteAcceso.Visible; }
            set
            {
                this.uxPermiteAccesoLabel.Visible = value;
                this.uxPermiteAcceso.Visible = value;
            }
        }

        /// <summary>
        /// Indicates if the controls associated with the uxPermiteAcceso property should be enabled.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Enabled property for related controls.")]
        public bool uxPermiteAccesoEnabled
        {
            get { return this.uxPermiteAcceso.Enabled; }
            set
            {
                this.uxPermiteAcceso.Enabled = value;
            }
        }
        /// <summary>
        /// Indicates if the controls associated with the uxPermiteEscritura property should be visible.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Visible property for related controls.")]
        public bool uxPermiteEscrituraVisible
        {
            get { return this.uxPermiteEscritura.Visible; }
            set
            {
                this.uxPermiteEscrituraLabel.Visible = value;
                this.uxPermiteEscritura.Visible = value;
            }
        }

        /// <summary>
        /// Indicates if the controls associated with the uxPermiteEscritura property should be enabled.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Enabled property for related controls.")]
        public bool uxPermiteEscrituraEnabled
        {
            get { return this.uxPermiteEscritura.Enabled; }
            set
            {
                this.uxPermiteEscritura.Enabled = value;
            }
        }
        /// <summary>
        /// Indicates if the controls associated with the uxPermisosEspeciales property should be visible.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Visible property for related controls.")]
        public bool uxPermisosEspecialesVisible
        {
            get { return this.uxPermisosEspeciales.Visible; }
            set
            {
                this.uxPermisosEspecialesLabel.Visible = value;
                this.uxPermisosEspeciales.Visible = value;
            }
        }

        /// <summary>
        /// Indicates if the controls associated with the uxPermisosEspeciales property should be enabled.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Enabled property for related controls.")]
        public bool uxPermisosEspecialesEnabled
        {
            get { return this.uxPermisosEspeciales.Enabled; }
            set
            {
                this.uxPermisosEspeciales.Enabled = value;
            }
        }

        #endregion

		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	}
}
